package com.pet_service.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pet_service.entity.User;
import com.pet_service.result.Result;
import com.pet_service.vo.GrantRoleBean;
import com.pet_service.vo.PasswordBean;
import com.pet_service.vo.UserWithPetsVO;

import java.util.List;

/**
* @author 邹全伸
* @description 针对表【user(用户表)】的数据库操作Service
* @createDate 2025-09-20 09:18:18
*/
public interface UserService extends IService<User> {
    //获取用户权限信息
    String getUserAuthorityInfo(Integer userId);

    //检查用户名是否重复
    Result checkUserName(String username);

    //检查手机号是否重复
    Result checkUserPhone(String userPhone);

    //批量删除用户
    Result removeByUserIdList(List<Integer> ids);

    //分配角色
    Result grantRole(GrantRoleBean grantRoleBean);

    //修改用户信息
    Result updateBaseInfo(User user);

    //修改密码
    Result updatePassword(PasswordBean passwordBean);

    //分页查询指定角色的用户
    IPage<User> pageByRoleCode(Page<User> page, String customer, String query);

    //根据用户id查询用户信息及用户所拥有的宠物信息
    UserWithPetsVO getUserWithPets(Integer userId);

}
